var MongoClient = require('mongodb').MongoClient;
var assert = require('assert');

var url = 'mongodb://localhost:27017/nodexuexi';

function exec(dataObj){
	MongoClient.connect(url, function(err, db) {
	  assert.equal(null, err);

	  dataObj(db, function(r) {
	    db.close();
	  });

	});
}


exports.exec = exec;